package com.diorsunion.hedge.web.controller;

import com.diorsunion.hedge.bo.sms.SmsConfig;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Scope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * Created by harley-dog on 2016/5/7.
 */
@RestController
@Scope("prototype")
@RequestMapping("/test")
public class TestController {

    @Value("${runtime.environment}")
    String runtime;
    @RequestMapping(value = "/", method = {RequestMethod.GET})
    @ResponseBody
    public JsonResult<Object> query() {
        return JsonResult.succResult("error");
    }


    @Resource
    SmsConfig smsConfig;
    @RequestMapping(value = "/sms", method = {RequestMethod.GET})
    @ResponseBody
    public JsonResult<Object> sms() {
        return JsonResult.succResult(smsConfig);
    }
}
